<?php
Class User extends CI_Model
{
	
	
 function login($username, $password)
 {
   $this -> db -> select('username, password');
   $this -> db -> from('users');
   $this -> db -> where('USERNAME',$username);
   $this -> db -> where('PASSWORD',$password);
   $this -> db -> limit(1);

   $query = $this -> db -> get('');

   if($query -> num_rows() == 1)
   {
     return $query->result();
   }
   else
   {
     return false;
   }
 }
 
function add_users() {
		$USERNAME = $this->input->post('USERNAME');
		$PASSWORD = $this->input->post('PASSWORD');
		$GENDER = $this->input->post('GENDER');
		$EMAIL = $this->input->post('EMAIL');
		$BIRTHDATE = $this->input->post('BIRTHDATE');
		$data = array(
			'USERNAME' => $USERNAME,
			'PASSWORD' => $PASSWORD,
			'GENDER' => $GENDER,
			'EMAIL' => $EMAIL,
			'BIRTHDATE' => $BIRTHDATE
			);
		$this->db->insert('users', $data);
	}
}
?>
